@/*
表单中input框标签中各个参数的说明:

hidden : input hidden框的id
id : input框id
name : input框名称
readonly : readonly属性
clickFun : 点击事件的方法名
style : 附加的css属性
@*/
<div id="${id}" name="${id}">
    @for(item in list){
    <div value="${item.id}" style="margin: 5px;">
        <span style="display: inline-block;width: 12%">${item.customerName}</span>
        <span style="display: inline-block;width: 20%">${item.customerPhone}</span>
        <span style="display: inline-block;width: 11%">${item.phoneSharShip}</span>
        <span style="display: inline-block;width: 10%">${item.sex}</span>
        <span style="display: inline-block;width: 10%">${item.customerAge}</span>
        <span style="display: inline-block;width: 20%">${item.medicalRecordNumber}</span>
        <span id="${item.id}"></span>
    </div>
    <script>
        /*if ("${item.customerStatus}" == "老客") {
            txt = '<button type="button" class="add${item.id} btn" id="add${item.id}" value="${item.id}" style="padding: 2px 12px;margin: 0;color: white;background: #2b6594;>重咨</button>' +
                '<button type="button" class="reDiagnosis${item.id} btn" id="reDiagnosis${item.id}" value="${item.id}" style="padding: 2px 12px;margin: 0;color: white;background: #2b6594;>复诊</button>';
            document.getElementById('${item.id}').innerHTML = txt;
            var reDiagnosis${item.id} = document.getElementsByClassName('reDiagnosis${item.id}')[0];    //加
            reDiagnosis${item.id}.onclick = function () {
                var operation = function () {
                    $.ajax({
                        url: "${ctxPath}/customer/to_reDiagnosis",
                        type: "post",
                        data: {
                            "customerId": document.getElementById('reDiagnosis${item.id}').value
                        },
                        success: function (data) {
                            console.log(data);
                            if (data == 0) {
                                alert("客户今天已到过院");
                            } else {
                                alert("复诊添加成功！");
                                window.parent.parent.$('#calendar').fullCalendar('refetchEvents');
                                window.parent.layer.close(parent.layer.getFrameIndex(window.name));
                            }
                        },
                        error: function (data) {
                            alert('内部故障！请联系管理员！');
                        }
                    });
                }
                Feng.confirm("是否添加复诊?", operation);
            }
            var add${item.id} = document.getElementsByClassName('add${item.id}')[0];    //加
            add${item.id}.onclick = function () {
                var index = layer.open({
                    type: 2,
                    title: '添加到店客户',
                    area: ['90%', '90%'], //宽高
                    fix: true, //不固定
                    maxmin: true,
                    content: Feng.ctxPath + '/customer/to_reconsultingd/' + document.getElementById('add${item.id}').value
                });
                this.layerIndex = index;
            };
        } else {*/
            if ("${item.arrivalStatus}" == "1") {
                txt = '<button type="button" class=" add${item.id} btn" id="add${item.id}" value="${item.id}" style="padding: 2px 12px;margin: 0;color: white;background: #2b6594;">挂号</button>'
                document.getElementById('${item.id}').innerHTML = txt;
                var add${item.id} = document.getElementsByClassName('add${item.id}')[0];    //加
                add${item.id}.onclick = function () {
                    $.ajax({
                        url: Feng.ctxPath + "/doctorLooked/regresses",
                        type: "post",
                        data: {
                            "customerId": document.getElementById('add${item.id}').value
                        },
                        success: function (data) {
                            alert('挂号成功!');
                            window.parent.layer.close(parent.layer.getFrameIndex(window.name));
                            window.parent.Customer.table.refresh();
                        },
                        error: function (data) {
                            alert('内部故障!');
                        }
                    });
                };
            } else {
                txt = '<button type="button" class="add${item.id} btn" id="add${item.id}" value="${item.id}" style="padding: 2px 12px;margin: 0;color: white;background: #2b6594;">复到</button>'
                document.getElementById('${item.id}').innerHTML = txt;
                var add${item.id} = document.getElementsByClassName('add${item.id}')[0];    //加
                add${item.id}.onclick = function () {
                    var index = layer.open({
                        type: 2,
                        title: '添加到店客户',
                        area: ['90%', '90%'], //宽高
                        fix: true, //不固定
                        maxmin: true,
                        content: Feng.ctxPath + '/customer/to_reconsultingd/' + document.getElementById('add${item.id}').value
                    });
                    this.layerIndex = index;
                };
            }
//        }
    </script>
    @}
</div>
@if(isNotEmpty(underline) && underline == 'true'){
<div class="hr-line-dashed"></div>
<script src="${ctxPath}/static/modular/arrival/customer/customer.js"></script>
@}


